package com.qiangou.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.entity.User;
import com.qiangou.dao.impl.UserDaoImpl;
import com.qiangou.service.UserService;


@Service("userService")
public class UserServiceImpl implements UserService{
	@Resource(name="userDao")
    private UserDaoImpl userDao;
	@Override
	public User login(String username,String password) {
		User user= userDao.getUserByUserName(username);
		if(user==null){
			return null;
		}
		if(password.equals(user.getPassword())){
			return user;
		}
		return null;
	}
	
}
